#!/bin/bash
echo "Please input directory name..."
       read directory
          if [ -d ${directory} ]
          then
       
          mkdir -p /home/ccav/zipfile
          zip=/home/ccav/zipfile
          echo "input y or n to confirm"
          read confirm
              if [ $confirm = y ]
               then
                date=`date +"%y-%m-%d_%H:%M:%S"`
                echo "Is backup, please wait a moment"
                tar -czpvf ${zip}/${directory}${date}.tar.gz ${directory}
                 echo "Backup complete.."
                 else
                   exit
                 fi
              else
               echo "${directory} is not directory"
      fi
